describe("abs", function()
	local abs = require("math.abs")
	it("works for numbers", function()
		assert.equal(0, abs(0))
		assert.equal(42, abs(42))
		assert.equal(42, abs(-42))
		assert.equal(math.huge, abs(math.huge))
		assert.equal(math.huge, abs(-math.huge))
		local nan = abs(0 / 0)
		assert(nan ~= nan)
	end)
	it("works for custom number types", function()
		local fraction = require("math.fraction")
		assert.equal(fraction.from_number(0), abs(fraction.from_number(0)))
		assert.equal(fraction.new(2, 3), abs(fraction.new(2, 3)))
		assert.equal(fraction.new(2, 3), abs(fraction.new(-2, 3)))
	end)
end)
